<template>
  <div class="time">
    {{ time }}
  </div>
</template>

<script>
export default {
  data() {
    return {
      time: ''
    }
  },
  mounted() {
    setInterval(() => {
      this.getTime()
    }, 1000)
  },
  methods: {
    getTime() {
      const now = new Date()
      this.time = now.toLocaleString()
    }
  }
}
</script>

<style lang="scss" scoped>
.time{

}
</style>
